﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace frag_boardgame
{
    public class Dice
    {
        Random random = new Random();

        /// <summary>
        /// Throw the dice and get the number
        /// </summary>
        /// <returns></returns>
        public int ThrowDice()
        {

            return random.Next(1, 7);
        }
        
        /// <summary>
        /// Throw the dice n times and calculate the sum
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public int ThrowAndSum(int n)
        {
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += ThrowDice();
            }
            return sum;
        }
    }
}
